package com.missilike.core.utils;

import com.missilike.core.domain.AuthUser;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtils {

    public static AuthUser getAuthUser(){
        return (AuthUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

    public static Integer getCurrentUserId() {
        return getAuthUser().getId();
    }

}
